<template>
  <div id="home">
    <NavBar :bar-array="barArray"/>
    <div class="main">
      <router-view/>
    </div>
  </div>
</template>

<script>
import NavBar from '../components/NavBar'

const { ipcRenderer } = window.require('electron')
export default {
  name: 'Home',
  components: { NavBar },
  data () {
    return {
      barArray: [
        {
          text: '服务器',
          path: '/server'
        },
        {
          text: '客户端',
          path: '/client'
        }
      ]
    }
  },
  created () {
    ipcRenderer.on('receiveMessage', (event, message) => {
      this.$store.commit('pushServerRecord', message)
    })
  }
}
</script>

<style scoped>
#home {
  padding: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
}

.main {
  width: 100%;
  height: calc(100% - 37px);
  border: 1px transparent solid;
}
</style>
